#ifndef X_F_H
#define X_F_H

#include "common.h"

// Footprint
// There's a copy for every instance, not just every kind of footprint.
template <AllegroVersion version>
struct x0F
{
    uint32_t t;
    uint32_t k;
    uint32_t ptr1; // Refers to `G1`, `G2`, `G3`, etc. string...?
    char s[32];
    uint32_t ptr2; // Points to x06
    uint32_t ptr3; // Points to x11
    uint32_t un;   // Always null?
    
    uint32_t TAIL;
    operator x0F<A_174>() const;
    static constexpr AllegroVersion versions[2] = {A_172, A_174};
};

#if __cplusplus >= 202002L
template <AllegroVersion version> requires(version >= A_172)
struct x0F<version>
{
    uint32_t t;
    uint32_t k;
    uint32_t ptr1; // Refers to `G1`, `G2`, `G3`, etc. string...?
    char s[32];
    uint32_t ptr2; // Points to x06
    uint32_t ptr3; // Points to x11
    uint32_t un;   // Always null?

    uint32_t un2;
    COND_FIELD(version >= A_174, uint32_t, un3);

    uint32_t TAIL;
    operator x0F<A_174>() const;
    static constexpr AllegroVersion versions[2] = {A_172, A_174};
};
#else
template <> struct x0F<A_172>
{
    uint32_t t;
    uint32_t k;
    uint32_t ptr1; // Refers to `G1`, `G2`, `G3`, etc. string...?
    char s[32];
    uint32_t ptr2; // Points to x06
    uint32_t ptr3; // Points to x11
    uint32_t un;   // Always null?

    uint32_t un2;

    uint32_t TAIL;
    operator x0F<A_174>() const;
    static constexpr AllegroVersion versions[2] = {A_172, A_174};
};

template <> struct x0F<A_174>
{
    uint32_t t;
    uint32_t k;
    uint32_t ptr1; // Refers to `G1`, `G2`, `G3`, etc. string...?
    char s[32];
    uint32_t ptr2; // Points to x06
    uint32_t ptr3; // Points to x11
    uint32_t un;   // Always null?

    uint32_t un2;
    uint32_t un3;

    uint32_t TAIL;
    operator x0F<A_174>() const;
    static constexpr AllegroVersion versions[2] = {A_172, A_174};
};
#endif

#endif // X_F_H
